set the fileName of castLib 3 to the pathName & "empty.cst"
end
on checkversion
if the controlDown then
put "Internet The City(tm) " & gVersionType & " Version 1.02 IE/NS 5/29/97" into line 1 of msg
put "Platform: " & the platform into line 2 of msg
put "Memorysize = " & the memorysize / 1024 into line 3 of msg
put "Free Memory = " & the freeBytes / 1024 into line 4 of msg
put "Free Block = " & the freeBlock / 1024 into line 5 of msg
put "Color Depth = " & the colorDepth into line 6 of msg
alert(msg)
end if
end
on setglobals
getplat()
set gCreditsScreen to label("credits")
case gVersionType of
#Lite:
set gCDGuidelist to [[1, 2, 3], []]
set gTotalDiscs to 1
set gcdno to 0
set gPrintScreen to label("print(disabled)")
set frameoffset to 1
set gMainFrame to label("main")
#mini1:
set gCDGuidelist to [[1, 2, 3], []]
set gTotalDiscs to 1
set gcdno to 0
set gPrintScreen to label("print")
set frameoffset to 0
set gMainFrame to label("minimain")
set gCreditsScreen to label("minicredits")
set the visible of sprite 21 to 0
otherwise:
set gCDGuidelist to [[2], [1, 3]]
set gcdno to 0
set gTotalDiscs to 2
set gPrintScreen to label("print")
set frameoffset to 0
set gMainFrame to label("main")
end case
set gDboxType to #CDswap
set gVideoSprite to 40
set gGuideChosen to 0
set gmovieobj to 0
set gBuildingChosen to 4
set gHIliteSprite to 47
puppetSprite(gHIliteSprite, 1)
set gBlimpSprite to 15
set gBlimpSpeed to getAt([-1, 1], random(2))
set gblimploc to 690
case gBlimpSpeed of
1:
set gblimploc to -50
(-1):
set gblimploc to 690
end case
set gBlimpPause to 2
set gTaxiflown to 0
set gStopActions to 0
set gAfterSwapScript to EMPTY
set gMovieFrame to label("movies")
set gTutorialFrame to label("tutorials")
set gGuideFrame to label("guides")
set gGuide1Frame to label("guidemov1")
set gGuide2Frame to label("guidemov2")
set gGuide3Frame to label("guidemov3")
set gBuilding1 to label("Building1") + frameoffset
set gBuilding2 to label("Building2") + frameoffset
set gBuilding3 to label("Building3") + frameoffset
set gBuilding4 to label("Building4")
set gBuilding5 to label("Building5") + frameoffset
set gBuilding6 to label("Building6") + frameoffset
set gBuilding7 to label("Building7")
set gBuilding8 to label("Building8")
set gAfterMovieFrame to gGuideFrame
set gDefaultText to 0
setdefaulttext("txt_mov.PIC")
set gLMspritelist to [17, 18, 19, 20, 21, 22]
set gUMspritelist to [30, 31, 32, 33, 34, 35, 36, 37]
set gHiliteobj to 0
set gTextSprite to 23
set gUpperTextSprite to 38
set guppertext to 65
puppetSprite(gTextSprite, 1)
set gMovieMaxed to 0
set gMovieIncrement to 0
set gGuideInitial to "e"
if voidp(gDriveletter) then
set gDriveletter to "D:"
end if
if gPC then
set gfilepath to gDriveletter & "\fREFd\"
end if
set gSliderSprite to 46
set gLastframe to gGuideFrame
set gRollWaitTime to 60
set gPrintlist to []
set gLMObjList to []
set gUMObjList to []
set gNetClicked to 0
clearUPPERmenu()
setCDscript()
end
on checkQuicktime
if the quickTimePresent then
exit
end if
alert("QuickTime has not been properly installed on this computer. Please refer to the ITC installation instructions to install the correct version of QuickTime.")
set the memberNum of sprite gUpperTextSprite to which
end
on preloadMenu
case gVersionType of
#mini1:
repeat with x = 169 to 173
preloadMember(member x of castLib 1)
end repeat
otherwise:
repeat with x = 181 to 196
preloadMember(member x of castLib 1)
end repeat
end case
end
on preloadguides
repeat with x in [198, 199, 200, 202, 203, 204, 206, 207, 208, 210, 211, 212, 213]
preloadMember(member x of castLib 1)
end repeat
end
on UnloadGuides
repeat with x = 198 to 213
unloadMember(member x of castLib 1)
end repeat
unloadguidemovies()
unloadMember(member 114 of castLib 1)
end
on unloadguidemovies
if the fileName of castLib 3 contains "empty.cst" then
exit
end if
repeat with x = 4 to 6
unloadMember(member x of castLib 3)
end repeat
end
on unloadMenu
repeat with x = 170 to 196
unloadMember(member x of castLib 1)
end repeat
unloadMember(member 117 of castLib 1)
unloadMember(member 166 of castLib 1)
end
on unloadmovies
repeat with x = 100 to 108
unloadMember(member x of castLib 1)
end repeat
end
on waitUntil4
repeat while the timer < (4 * 60)
go(the frame)
end repeat
end
on over
cursor(4)
endmovie()
set the visible of sprite gVideoSprite to 0
repeat with x = 1 to 48
puppetSprite(x, 0)
end repeat
go(1)
startTimer()
set the visible of sprite gVideoSprite to 1
waitUntil4()
pause()
stopMovie()
cursor(-1)
quit()
abort()
end
on wait howlong
set endtime to the ticks + howlong
repeat while the ticks < endtime
end repeat
end
on waitSound
repeat while soundBusy(1)
updateStage()
end repeat
end
on unloadbuilding
set memberno to getAt([253, 263, 269, 237, 266, 244, 275, 279], gBuildingChosen)
set castlist to [memberno, memberno - 1, 228, 225]
repeat with x in castlist
unloadMember(member x of castLib 1)
end repeat
end
on unloadCafe
repeat with x = 230 to 240
unloadMember(member x of castLib 1)
end repeat
unloadMember(member 123 of castLib 1)
end
on soundinit
set the volume of sound 1 to 0
playclick()
set the volume of sound 1 to 255
end
on clearmember num
unloadMember(member num of castLib 1)
end
on manageunload where
if the freeBytes > 1600000 then
exit
end if
set f to marker(0)
case f of
gGuideFrame:
UnloadGuides()
gGuide1Frame:
UnloadGuides()
gGuide2Frame:
UnloadGuides()
gGuide3Frame:
UnloadGuides()
gMainFrame:
unloadMenu()
gBuilding1:
clearmember(253)
clearmember(252)
gBuilding2:
clearmember(263)
clearmember(262)
gBuilding3:
clearmember(269)
clearmember(268)
gBuilding4:
unloadCafe()
gBuilding5:
clearmember(266)
clearmember(265)
gBuilding6:
clearmember(244)
clearmember(243)
gBuilding7:
clearmember(275)
clearmember(274)
gBuilding8:
clearmember(279)
clearmember(278)
gTutorialFrame:
unloadbuilding()
unloadmovies()
gCreditsScreen:
unloadcredits()
if where <> gMainFrame then
unloadMenu()
end if
end case
end
on checkmemory
set fb to the freeBytes
if fb > 2000000 then
preloadguides()
preloadMenu()
else
if fb < 1000000 then
exit
if the colorDepth <= 8 then
alert("Memory setting is low. You may have trouble running ITC! (Hold down Control Key to skip this message)")
else
alert("You may have trouble running ITC at this color depth! For best results, increase available memory or reduce your monitor's color setting to fewer colors. (Hold down Control Key to skip this message)")
end if
end if
end if
end
on startBlimp
puppetSprite(gBlimpSprite, 1)
set gblimptrigger to the ticks + gBlimpPause
set the locH of sprite gBlimpSprite to gblimploc
case gBlimpSpeed of
1:
set the memberNum of sprite gBlimpSprite to 178
(-1):
set the memberNum of sprite gBlimpSprite to 177
end case
end
on flipBlimp
if random(10) > 4 then
if gTaxiflown < 2 then
setTaxi()
exit
end if
end if
set gBlimpPause to 2
if (gTaxiflown mod 2) = 0 then
set gBlimpSpeed to 0 - gBlimpSpeed
end if
if gBlimpSpeed > 0 then
set gBlimpSpeed to 1
set gblimploc to -50
set the memberNum of sprite gBlimpSprite to 178
else
set gBlimpSpeed to -1
set gblimploc to 690
set the memberNum of sprite gBlimpSprite to 177
end if
set the locV of sprite gBlimpSprite to 10 + (random(8) * 10)
if gTaxiflown then
set gTaxiflown to 0
unloadtaxi()
end if
end
on flyblimp
if the ticks < gblimptrigger then
exit
end if
set gblimploc to gblimploc + gBlimpSpeed
set gblimptrigger to the ticks + gBlimpPause
if gblimploc < -50 then
flipBlimp()
else
if gblimploc > 690 then
flipBlimp()
else
set the locH of sprite gBlimpSprite to gblimploc
end if
end if
end
on setTaxi
set gBlimpPause to 0
set gBlimpSpeed to 0 - gBlimpSpeed
if gBlimpSpeed > 0 then
set gBlimpSpeed to 10
set gblimploc to -50
set the memberNum of sprite gBlimpSprite to 176
else
set gBlimpSpeed to -10
set gblimploc to 690
set the memberNum of sprite gBlimpSprite to 175
end if
set the locV of sprite gBlimpSprite to random(7) * 50
set gTaxiflown to gTaxiflown + 1
if not soundBusy(1) then
puppetSound("taxisnd")
end if
end
on unloadtaxi
puppetSound(0)
repeat with x = 174 to 176
clearmember(x)
end repeat
end
on flashcafe
if the timer < 60 then
go(gMainFrame)
else
go(gMainFrame + 4)
if the timer > 120 then
startTimer()
end if
end if
end
on unloadprint
repeat with x = 141 to 144
clearmember(x)
end repeat
end
on unloaddialog
repeat with x = 137 to 152
clearmember(x)
end repeat
end
on ifRightCD what
set gAfterSwapScript to what
checkRightCD()
if gRightCD = 0 then
switchcd()
exit
end if
do(gAfterSwapScript)
set gAfterSwapScript to EMPTY
end
on checkCDno
set temp to gcdno
case gPC of
0:
if getNthFileNameInFolder("ITC2:frefd:", 1) = "aaaa2" then
set gcdno to 2
else
if getNthFileNameInFolder("ITC1:frefd:", 1) = "aaaa1" then
set gcdno to 1
else
if getNthFileNameInFolder("ITC:frefd:", 1) = "aaaa1" then
set gcdno to 1
else
set gcdno to 0
exit
end if
end if
end if
otherwise:
set filepath to gDriveletter & "\frefd\"
if getNthFileNameInFolder(filepath, 1) = "aaaa2" then
set gcdno to 2
else
if getNthFileNameInFolder(filepath, 1) = "aaaa1" then
set gcdno to 1
else
set gcdno to 0
exit
end if
end if
end case
if temp <> gcdno then
setcastlib()
end if
end
on checkRightCD
checkCDno()
set gRightCD to 0
case gcdno of
1:
set gCDready to 1
set wrongguides to getAt(gCDGuidelist, 2)
if getOne(wrongguides, gGuideChosen) then
setCDscript()
cleardbox()
exit
end if
2:
set gCDready to 1
set wrongguides to getAt(gCDGuidelist, 1)
if getOne(wrongguides, gGuideChosen) then
setCDscript()
cleardbox()
exit
end if
0:
set gCDready to 0
exit
end case
set gRightCD to 1
swapdone()
end
on switchcd
cursor(4)
puppetSprite(41, 1)
set cdneeded to 1
case gVersionType of
#Lite:
if gPC = 16 then
set castno to the number of member "swap313.pic"
cursor(-1)
else
set castno to the number of member "swap3.pic"
end if
set CDname to "ITC"
#mini1:
if gPC = 16 then
set castno to the number of member "swap311.pic"
cursor(-1)
else
set castno to the number of member "swap1.pic"
end if
set CDname to "ITC1"
otherwise:
repeat with x = 1 to gTotalDiscs
if getOne(getAt(gCDGuidelist, x), gGuideChosen) then
set cdneeded to x
exit repeat
end if
end repeat
set CDname to "ITC" & gcdno & ":"
case cdneeded of
2:
if gPC = 16 then
set castno to the number of member "swap312.pic"
cursor(-1)
else
set castno to the number of member "swap2.pic"
end if
otherwise:
if gPC = 16 then
set castno to the number of member "swap311.pic"
cursor(-1)
else
set castno to the number of member "swap1.pic"
end if
end case
end case
set gDboxType to #CDswap
set the memberNum of sprite 41 to castno
set the loc of sprite 41 to point(320, 240)
updateStage()
unloadguidemovies()
if (gPC = 0) and gCDready then
if gTotalDiscs > 1 then
checkpurge()
openXLib("lns")
unmount(CDname)
closeXLib("lns")
end if
end if
set gCDready to 0
set gStopActions to 1
end
on swapdone
cleardbox()
do(gAfterSwapScript)
set gAfterSwapScript to EMPTY
setCDscript()
end
on setcastlib
if gPC = 0 then
case gVersionType of
#Lite:
set gfilepath to "ITC:frefd:"
otherwise:
set gfilepath to "ITC" & gcdno & ":frefd:"
end case
end if
set the searchPath to [gfilepath]
set the searchCurrentFolder to 0
unLoad(castLib 3)
set the fileName of castLib 3 to the pathName & "tut" & gcdno & ".cst"
set the searchCurrentFolder to 1
end
on clickDbox
case gDboxType of
#CDswap:
clickCdswap()
#Net:
clicknetbox()
#OK:
clickOK()
end case
end
on clickCdswap
set c to point(the mouseH, the mouseV)
case gPC of
16:
if inside(c, rect(353, 324, 410, 356)) then
paintpict(point(381, 339), "imp_ok.PIC", 1, 0)
quickclick()
repeat while the mouseDown
end repeat
paintpict(point(381, 339), "imp_ok.PIC", 0, 0)
if inside(point(the mouseH, the mouseV), rect(353, 324, 410, 356)) then
checkRightCD()
end if
else
if inside(c, rect(226, 325, 332, 356)) then
paintpict(point(277, 339), "imp_canc.pic", 1, 0)
quickclick()
repeat while the mouseDown
end repeat
paintpict(point(277, 339), "imp_canc.pic", 0, 0)
if inside(point(the mouseH, the mouseV), rect(226, 325, 332, 356)) then
set gAfterSwapScript to EMPTY
cleardbox()
set gCDready to 1
setCDscript()
go(the frame)
abort()
exit
end if
end if
end if
otherwise:
if inside(c, rect(266, 324, 372, 356)) then
paintpict(point(316, 338), "imp_canc.pic", 1, 0)
quickclick()
repeat while the mouseDown
end repeat
paintpict(point(316, 338), "imp_canc.pic", 0, 0)
if inside(point(the mouseH, the mouseV), rect(266, 324, 372, 356)) then
set gAfterSwapScript to EMPTY
cleardbox()
set gCDready to 1
setCDscript()
go(the frame)
abort()
exit
end if
end if
end case
end
on cleardbox
set gStopActions to 0
set the locV of sprite 41 to 999
puppetSprite(41, 0)
updateStage()
unloaddialog()
waitSound()
cursor(-1)
end
on scrollcredits
if gcreditscroll < gscrolllength then
set gcreditscroll to gcreditscroll + 4
set the scrollTop of member "credits" to gcreditscroll
updateStage()
else
set endtime to the ticks + 100
repeat while the ticks < endtime
flyblimp()
updateStage()
end repeat
navigate(gMainFrame)
unloadcredits()
end if
end
on gocredits
set the scrollTop of member "credits" to 0
set gcreditscroll to 0
puppetSprite(gBlimpSprite, 0)
navigate(gCreditsScreen)
set gscrolllength to the height of member "credits" - 400